home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Interapplication Comm / MoreAppleEvents / FinderRegistry.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  9.2 KB  |  370 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        FinderRegistry.h
  3.  
  4.     Contains:    Classes, properties and data types used by the Scriptable Finder
  5.  
  6.     Written by: Francis Stanbach & Greg Anderson    
  7.  
  8.     Copyright:    Copyright © 1991-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/21/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24. #ifndef __FINDERREGISTRY__
  25. #define __FINDERREGISTRY__
  26. #define FinderRegistry_h
  27.  
  28. #ifndef __AEREGISTRY__
  29. #include "AERegistry.h"
  30. #endif
  31.  
  32. ////////////////////////////////////////
  33. // Finder Suite
  34. ////////////////////////////////////////
  35.  
  36. //
  37. // The old Finder Event suite was 'FNDR'
  38. // The new suite is 'fndr'
  39. //
  40. enum {
  41.     kAEFinderSuite                = 'fndr'
  42. };
  43.  
  44. ////////////////////////////////////////
  45. // Finder Events
  46. ////////////////////////////////////////
  47.  
  48. enum {
  49.     kAECleanUp                    = 'fclu',
  50.     kAEEject                    = 'ejct',
  51.     kAEEmpty                    = 'empt',
  52.     kAEErase                    = 'fera',
  53.     kAEGestalt                    = 'gstl',
  54.     kAEPutAway                    = 'ptwy',
  55.     kAERebuildDesktopDB            = 'rddb',
  56.     kAESnooze                    = 'snoz',                // Go to sleep
  57.     kAEUpdate                    = 'fupd'
  58. };
  59.  
  60. ////////////////////////////////////////
  61. // Classes
  62. ////////////////////////////////////////
  63.  
  64. enum {
  65.     cFinder                        = cApplication,        // the finder object ≈ null
  66.  
  67.     cDisk                        = 'cdis',
  68.     cFolder                        = 'cfol',
  69.     cTrash                        = 'ctrs',
  70.     cDesktop                    = 'cdsk',
  71.     cContainer                    = 'ctnr',                // Disks, folders, trashes, desktops, suitcases
  72.     cSharableContainer            = 'sctr',                // Disks and folders
  73.     cSuitcase                    = 'stcs',
  74.     cFontSuitcase                = 'fsut',
  75.     cAccessorySuitcase            = 'dsut',
  76.  
  77.     cAliasFile                    = 'alia',
  78.  
  79.     cApplicationFile            = 'appf',
  80.     cDocumentFile                = 'docf',
  81.     cControlPanel                = 'ccdv',
  82.     cDeskAccessoryFile            = 'dafi',
  83.     cSoundFile                    = 'sndf',
  84.     cFontFile                    = 'fntf',
  85.  
  86.     cContentSpace                = 'dwnd',                // Content space:  includes desktop window & other windows
  87.     cContainerWindow            = 'cwnd',
  88.     cInfoWindow                    = 'iwnd',
  89.     cSharingWindow                = 'swnd',
  90.     cStatusWindow                = 'qwnd',                // Empty trash progress, 'copy' window
  91.  
  92.     cPrivilege                    = 'priv',
  93.     cGestalt                    = 'cgst',
  94.     cProcess                    = 'prcs',                // Information about a process running on this machine (like cApplication)
  95.     cAccessoryProcess            = 'pcda',
  96.     cApplicationProcess            = 'pcap',
  97.  
  98.     cEntireContents                = 'ects',
  99.  
  100.     cUser                        = 'cuse',
  101.     cGroup                        = 'sgrp',
  102.  
  103.     cIconFamily                    = 'ifam'
  104. };
  105.  
  106. ////////////////////////////////////////
  107. // Properties
  108. ////////////////////////////////////////
  109.  
  110. //
  111. // Properties of cObject:
  112. //
  113. enum {
  114.     pComment                    = 'comt',
  115.     pContainer                    = cContainer,            // The container the object is stored in
  116.     pCreationDate                = 'crtd',
  117.     pDemiWindow                    = cContentSpace,
  118.     pDisk                        = cDisk,                // the disk the object is stored on
  119.     pIconBitmap                    = 'iimg',
  120.     pInformationWindow            = cInfoWindow,            // Get info window
  121.     pStatusWindow                = cStatusWindow,        // Status window (copy, empty trash, rebuild desktop database)
  122.     pIsLocked                    = 'islk',
  123.     pIsSelected                    = 'issl',
  124.     pKind                        = 'kind',
  125.     pModificationDate            = 'modd',
  126.     pPhysicalSize                = 'phys',
  127.     pPosition                    = 'posn',
  128.     pSize                        = pPointSize,            // both are called "Size" in their respective terminologies, so they must have the same four-character code
  129.     pWindow                        = cWindow
  130. };
  131.  
  132. //
  133. // Properties of cFile:
  134. //
  135. enum {
  136.     pCreatorType                = 'fcrt',
  137.     pFileType                    = 'fitp',
  138.     pVersion2                    = 'ver2'
  139. };
  140.  
  141. //
  142. // Properties of cAliasFile:
  143. //
  144. enum {
  145.     pOriginalItem                = 'orig'                // Item pointed to by alias
  146. };
  147.  
  148. //
  149. // Properties of cApplicationFile:
  150. //
  151. enum {
  152.     pAppPartition                = 'appt',
  153.     pSuggestedAppPartition        = 'sprt',
  154.     pMinAppPartition            = 'mprt'
  155. };
  156.  
  157. //
  158. // Properties of cContainer:
  159. //
  160. enum {
  161.     pContainerWindow            = cContainerWindow,    // Window that contains children
  162.     pEntireContents                = cEntireContents,
  163.     pLabelIndex                    = 'labi',
  164.     pExpanded                    = 'pexp',                // Same as kAEExpanded
  165.     pExpandable                    = 'pexa',
  166.     pCompletelyExpanded            = 'pexc',
  167.     pSharingWindow                = cSharingWindow,        // Sharing window
  168.     pView                        = 'pvew',
  169.     pPreviousView                = 'svew',                // The last listwindow (non-icon) view
  170.  
  171.     pSharing                    = 'shar',
  172.     pSharingProtection            = 'spro',
  173.     pExported                    = 'sexp',
  174.     pMounted                    = 'smou',
  175.     pInheritedPrivileges        = 'iprv',                // "Same as enclosing" checkbox
  176.     pOwner                        = 'sown',
  177.     pGroup                        = cGroup,
  178.     pOwnerPrivileges            = 'ownr',
  179.     pGroupPrivileges            = 'gppr',
  180.     pGuestPrivileges            = 'gstp'
  181. };
  182.  
  183. //
  184. // Properties of cDisk:
  185. //
  186. enum {
  187.     pCapacity                    = 'capa',
  188.     pEjectable                    = 'isej',
  189.     pFreeSpace                    = 'frsp',
  190.     pLocal                        = 'isrv',
  191.     pIsStartup                    = 'istd'
  192. };
  193.  
  194. //
  195. // Properties of cDesktop:
  196. //
  197. enum {
  198.     pTrash                        = 'trsh',                // Can't use cTrash, and pTrash must == kTrashFolderType
  199.     pStartupDisk                = 'sdsk'
  200. };
  201.  
  202. //
  203. // Properties of cTrash:
  204. //
  205. enum {
  206.     pWarnOnEmpty                = 'warn'
  207. };
  208.  
  209. //
  210. // Properties of cFinder / cApplication:
  211. //
  212. enum {
  213.     pAppleMenuItemsFolder        = 'amnu',                // kAppleMenuFolderType
  214.     pControlPanelsFolder        = 'ctrl',                // kControlPanelFolderType
  215.     pDesktop                    = 'desk',                // Can't use cDesktop, and pDesktop must == kDesktopFolderType
  216.     pExtensionsFolder            = 'extn',                // kExtensionFolderType
  217.     pFileShareOn                = 'fshr',
  218.     pFileShareStartingUp        = 'fsup',
  219.     pFontsFolder                = 'ffnt',
  220.  
  221.     pLargestFreeBlock            = 'mfre',
  222.     pPreferencesFolder            = 'pref',                // kPreferencesFolderType
  223.     pAboutMacintosh                = 'abbx',                // Open this to get 'About this Macintosh' window
  224.     pShortcuts                    = 'scut',                // Finder shortcuts in help menu
  225.     pShutdownFolder                = 'shdf',
  226.     pStartupItemsFolder            = 'strt',                // kStartupFolderType
  227.     pSystemFolder                = 'macs',                // kSystemFolderType
  228.     pTemporaryFolder            = 'temp',                // kTemporaryFolderType
  229.     pTimerItemsFolder            = 'timf',
  230.     pViewPreferences            = 'pvwp'                // Finder view preferences ("Views" control panel)
  231. };
  232.  
  233. //
  234. // View preferences properties
  235. //
  236. enum {
  237.     pViewFont                    = 'vfnt',
  238.     pViewFontSize                = 'vfsz',
  239.     pGridIcons                    = 'fgrd',
  240.     pListViewIconSize            = 'lvis',
  241.     pShowComment                = 'scom',
  242.     pShowDate                    = 'sdat',
  243.     pShowDiskInfo                = 'sdin',
  244.     pShowFolderSize                = 'sfsz',
  245.     pShowKind                    = 'sknd',
  246.     pShowLabel                    = 'slbl',
  247.     pShowSize                    = 'ssiz',
  248.     pShowVersion                = 'svrs',
  249.     pStaggerIcons                = 'fstg'
  250. };
  251.  
  252. //
  253. // Properties of cPrivilegs
  254. //
  255. enum {
  256.     pSeeFiles                    = 'prvr',
  257.     pSeeFolders                    = 'prvs',
  258.     pMakeChanges                = 'prvw'
  259. };
  260.  
  261. //
  262. // Properties of cProcess
  263. //
  264. enum {
  265.     pApplicationFile            = cApplicationFile,
  266.  
  267.     pDeskAccessoryFile            = cDeskAccessoryFile,
  268.     pIsScriptable                = 'isab',
  269.     pLocalAndRemoteEvents        = 'revt',
  270.     pPartitionSpaceUsed            = 'pusd',
  271.  
  272.     pFolder                        = cFolder,
  273.     pObject                        = cObject,
  274.     pSharableContainer            = cSharableContainer,
  275.     pSuitcase                    = cSuitcase,
  276.     pFontSuitcase                = cFontSuitcase,
  277.     pAccessorySuitcase            = cAccessorySuitcase
  278. };
  279.  
  280.  
  281. ////////////////////////////////////////
  282. // Enumerations defined by the Finder
  283. ////////////////////////////////////////
  284.  
  285. enum {
  286.     enumViewBy                    = 'vwby',
  287.     pSmallIcon                    = 'smic',
  288.     enumGestalt                    = 'gsen',
  289.     enumConflicts                = 'cflc',
  290.     enumExistingItems            = 'exsi'
  291. };
  292.  
  293. ////////////////////////////////////////
  294. // Types defined by the Finder
  295. ////////////////////////////////////////
  296.  
  297. enum {
  298.     typeIconFamily                = cIconFamily,            // An AEList of typeIconAndMask, type8BitIcon, & c.
  299.     typeIconAndMask                = 'ICN#',
  300.     type8BitIcon                = 'icl8',
  301.     type4BitIcon                = 'icl4',
  302.     typeSmallIconAndMask        = 'ics#',
  303.     typeSmall8BitIcon            = 'ics8',
  304.     typeSmall4BitIcon            = 'ics4'
  305. };
  306.  
  307. ////////////////////////////////////////
  308. // Keywords defined by the Finder
  309. ////////////////////////////////////////
  310.  
  311. enum {
  312.     keyIconAndMask                = 'ICN#',
  313.     key8BitIcon                    = 'icl8',
  314.     key4BitIcon                    = 'icl4',
  315.     keySmallIconAndMask            = 'ics#',
  316.     keySmall8BitIcon            = 'ics8',
  317.     keySmall4BitIcon            = 'ics4',
  318.  
  319.     keyAEUsing                    = 'usin',
  320.     keyAEReplacing                = 'alrp',
  321.  
  322.     keyLocalPositionList        = 'mvpl',
  323.     keyGlobalPositionList        = 'mvpg'
  324. };
  325.  
  326. ////////////////////////////////////////
  327. // New prepositions used by the Finder
  328. ////////////////////////////////////////
  329.  
  330. enum {
  331.     keyASPrepositionHas            = 'has ',
  332.     keyAll                        = 'kyal',
  333.     keyOldFinderItems            = 'fsel'
  334. };
  335.  
  336. ////////////////////////////////////////
  337. // New key forms used by the Finder
  338. ////////////////////////////////////////
  339.  
  340. enum {
  341.     formAlias                    = typeAlias,
  342.     formCreator                    = pCreatorType
  343. };
  344.  
  345. ////////////////////////////////////////
  346. // Finder error codes
  347. ////////////////////////////////////////
  348.  
  349. enum {
  350.     errFinderIsBusy                    = -15260,
  351.     errFinderWindowNotOpen            = -15261,
  352.     errFinderCannotPutAway            = -15262,
  353.     errFinderWindowMustBeIconView    = -15263,        // RequireWindowInIconView
  354.     errFinderWindowMustBeListView    = -15264,        // RequireWindowInListView
  355.     errFinderCantMoveToDestination    = -15265,
  356.     errFinderCantMoveSource            = -15266,
  357.     errFinderCantOverwrite            = -15267,
  358.     errFinderIncestuousMove            = -15268,        
  359.     errFinderCantMoveToAncestor        = -15269,        
  360.     errFinderCantUseTrashedItems    = -15270,
  361.     errFinderItemAlreadyInDest        = -15271,        // Move from folder A to folder A
  362.     errFinderUnknownUser            = -15272,        // Includes unknown group
  363.     errFinderSharePointsCantInherit    = -15273,
  364.  
  365.     errFinderBoundsWrong            = -15278,
  366.     errAEValueOutOfRange            = -15279
  367. };
  368.  
  369. #endif
  370.